package com.wenhao.single;

/**
 * 线程不安全
 *
 * @author Wenhao Tong
 * @create 2021-08-20 21:02
 */
public class Lazy {

    private static Lazy instance;

    private Lazy() {
        System.out.println(Thread.currentThread().getName() + "ok");
    }

    public Lazy getInstance() {
        if (instance == null) {
            instance = new Lazy();
        }
        return instance;
    }

    public static void main(String[] args) {

    }

}
